package demo2;

import java.util.HashMap;

public class Test {
    public static void main1(String[] args) {
        HashBuck hashBuck = new HashBuck();
        hashBuck.push(3,999);
        hashBuck.push(2,999);
        hashBuck.push(4,999);
        hashBuck.push(5,999);
        hashBuck.push(16,999);
        hashBuck.push(8,999);
        hashBuck.push(10,999);
        hashBuck.push(6,999);
        int value = hashBuck.get(10);
        System.out.println(value);
    }

    public static void main2(String[] args) {
        HashBuckPlus<String,Integer> hashBuckPlus = new HashBuckPlus<>();
        hashBuckPlus.push("张三",10);
        hashBuckPlus.push("张三",20);
        hashBuckPlus.push("李四",30);
        System.out.println(hashBuckPlus.get("李四"));
    }

    public static void main(String[] args) {
        Student student = new Student(1,"zhangssan");
        Student student1 = new Student(1,"zhangssan");
        Student student2 = new Student(2,"lisi");
        HashBuckPlus<Student,Integer> hashBuckPlus = new HashBuckPlus<>();
        hashBuckPlus.push(student,12);
        hashBuckPlus.push(student1,24);
        hashBuckPlus.push(student2,36);
        System.out.println(hashBuckPlus.get(student));
        System.out.println(hashBuckPlus.get(student1));
        System.out.println(hashBuckPlus.get(student2));
        System.out.println("----------------------------------");
        HashMap<Student,Integer> hashMap = new HashMap<>();
        hashMap.put(student,12);
        hashMap.put(student1,24);
        hashMap.put(student2,36);
        System.out.println(hashMap.get(student));
        System.out.println(hashMap.get(student1));
        System.out.println(hashMap.get(student2));
    }
}
